<?php

/**
 * Base configuration file for Harliane.
 * 
 * @version $Id: main.php,v 1.4 2011-10-02 21:38:17 herve Exp $
 * @copyright 2011
 */

// uncomment the following to define a path alias
// Yii::setPathOfAlias('local','path/to/local-folder');

// This is the main Web application configuration. Any writable
// CWebApplication properties can be configured here.
return array(
	'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
	'name'=>'My Web Application',

	// preloading 'log' component
	'preload'=>array('log'),

	// autoloading model and component classes
	'import'=>array(
		'application.models.*',
		'application.models.account.*',
		'application.models.common.*',
		'application.models.meeting.*',
		'application.models.project.*',
		'application.models.report.*',
		'application.models.search.*',
		'application.models.stats.*',
		'application.models.topics.*',
		'application.components.*',
		'application.components.parameter.*',
		'application.components.parameter.ar.*',
		'application.validators.*',
	),

	// application components
	'components'=>array(
		'log'=>array(
			'class'=>'CLogRouter',
			'routes'=>array(
				array(
					'class'=>'CFileLogRoute',
					'levels'=>'error, warning, info',
				),
				// uncomment the following to show log messages on web pages
				/*
				array(
					'class'=>'CWebLogRoute',
				),
				*/
			),
		),
		'authManager'=>array(
		    'class'=>'CDbAuthManager',
		    'connectionID'=>'db',
			'assignmentTable'=>'authassignment',
			'itemTable'=>'authitem',
			'itemChildTable'=>'authitemchild'
		),
		'user'=>array(
			// enable cookie-based authentication
			'allowAutoLogin' => false,
			'behaviors' => array(
				'rights' => array(
					'class' => 'UserBehavior'
				)
			)
		),
		// uncomment the following to enable URLs in path-format
		/*
		'urlManager'=>array(
			'urlFormat'=>'path',
			'rules'=>array(
				'<controller:\w+>/<id:\d+>'=>'<controller>/view',
				'<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
				'<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
			),
		),
		*/
		// uncomment the following to set up database
		'db'=>$db_connection,
		/*'errorHandler'=>array(
			// use 'site/error' action to display errors
            'errorAction'=>'site/error',
        ),*/
		'parameter'=>array(
			'class' => 'CParameterComponent',
			'connection' => 'db'
		),
	),

	'sourceLanguage' => 'en',

	// application-level parameters that can be accessed
	// using Yii::app()->params['paramName']
	'params'=>array(
		// this is used in contact page
		'adminEmail'=>'webmaster@example.com',
		'allowSimulation' => isset($allowSimulation) && $allowSimulation === true
	),
	
	'modules' => array('admin', 'adviser', 'reporting', 'service', 'simulation')
);